package com.dcivision.framework.taglib.channel;

import java.io.IOException;

import javax.servlet.jsp.JspException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.taglib.html.SummarizeContentTag;

public class AjaxSummarizeContentTag extends SummarizeContentTag {
  
  private Log log = LogFactory.getLog(this.getClass());
  AjaxWriter out = null;
  String ajaxIndexFlag = null;
  
  public String getAjaxContent() throws ApplicationException{
    try{
      out = (AjaxWriter)pageContext.getOut();
      out.clear();
      this.doStartTag();
      this.doEndTag();
      return out.getContent().toString();
    }catch(IOException ex){
      log.error(ex.getMessage(), ex);
      throw new ApplicationException(ex);
    }catch(JspException ex){
      log.error(ex.getMessage(), ex);
      throw new ApplicationException(ex);
    }
  }
}
